home *** CD-ROM | disk | FTP | other *** search
/ Aminet 49 / Aminet 49 (2002)(GTI - Schatztruhe)[!][Jun 2002].iso / Aminet / dev / gui / Feelin.lha / Feelin / ObjectList.e < prev    next >
Text File  |  2002-04-02  |  1KB  |  51 lines

  1. OPT PREPROCESS
  2.  
  3. MODULE 'exec/nodes','exec/semaphores',
  4.        'feelin','libraries/feelin'
  5.  
  6. PROC main()
  7.    DEF ss:PTR TO serverSemaphore,
  8.        nextc,obj:PTR TO feelinObject,family:PTR TO feelinObject,
  9.        nextw
  10.  
  11.    IF ss := FindSemaphore('Feelin\aServer')
  12.       IF feelinbase := OpenLibrary('feelin.library',NIL)
  13.          ObtainSemaphore(ss)
  14.  
  15.          nextc := ss.server.clients.head
  16.  
  17.          WHILE obj := F_NextObject({nextc})
  18.             WriteF('Client 0x\h\n',obj)
  19.  
  20.             family := F_Get(obj,FA_Family)
  21.             nextw := F_Get(family,FA_Family_Head)
  22.  
  23.             WHILE obj := F_NextObject({nextw})
  24.                WriteF('|  Window 0x\h (0x\h)\n',obj,obj.parent)
  25.                familytree(F_Get(obj,FA_Child),1) ; EXIT CtrlC()
  26.             ENDWHILE
  27.          ENDWHILE
  28.  
  29.          ReleaseSemaphore(ss)
  30.  
  31.          CloseLibrary(feelinbase)
  32.       ENDIF
  33.    ENDIF
  34. ENDPROC
  35.  
  36. PROC familytree(obj:PTR TO feelinObject,level)
  37.    DEF i,family,next,child
  38.  
  39.    FOR i := NIL TO level DO WriteF('|  ')
  40.  
  41.    WriteF('Obj 0x\h (0x\h)\n',obj,obj.parent)
  42.  
  43.    IF family := F_Get(obj,FA_Family)
  44.       next := F_Get(family,FA_Family_Head)
  45.  
  46.       WHILE child := F_NextObject({next})
  47.          familytree(child,level + 1) ; EXIT CtrlC()
  48.       ENDWHILE
  49.    ENDIF
  50. ENDPROC
  51.